package main

import "fmt"

func main() {
	a := 10
	b := a //值类型
	fmt.Println(a, b)
	a = 20
	fmt.Println(a, b)
	fmt.Println("-----------------------------------------------")

	// 数组为值类型
	var arr1 = [...]int{10, 20, 30, 40, 50}
	arr2 := arr1
	arr1[0] = 100
	fmt.Println(arr1, arr2)
	fmt.Println("-----------------------------------------------")

	// 切片为引用类型
	var arr3 = []int{10, 20, 30, 40, 50}
	arr4 := arr3
	arr3[0] = 100
	fmt.Println(arr3, arr4)
	fmt.Println("-----------------------------------------------")
	var arr5 = [...][2]int{
		{12, 1},
		{12, 2},
		{12, 3},
		{12, 4},
		{12, 5},
		{12, 6},
	}
	fmt.Println(arr5)
}
